package com.mojito.gorm.session.impl;

import com.mojito.gorm.session.GormConfiguration;
import com.mojito.gorm.session.GormSession;

/**
 * @author mojito
 */
public class GormSessionFactory {
    private GormConfiguration configuration;

    /**
     * 加载全局配置
     *
     * @return
     */
    public GormSessionFactory build() {
        configuration = new GormConfiguration();
        configuration.config();
        return this;
    }

    /**
     * 获取session
     *
     * @return
     */
    public GormSession openSession() {
        return new DefaultGormSession(configuration);
    }
}
